
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>文件管理系统</title>

    <!-- Bootstrap core CSS -->
    <link href="./Tpl/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="jumbotron.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">留言板</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <form class="navbar-form navbar-right">
            <div class="form-group">
              <input type="text" placeholder="Email" class="form-control">
            </div>
            <div class="form-group">
              <input type="password" placeholder="Password" class="form-control">
            </div>
            <button type="submit" class="btn btn-success">Sign in</button>
          </form>
        </div><!--/.navbar-collapse -->
      </div>
    </nav>

    <!-- Main jumbotron for a primary marketing message or call to action -->

    <?php $colors = ['alert alert-danger','alert alert-success','alert alert-info','alert alert-warning']; ?>
  
    <div class="container" style="padding-top:100px;">

      <form class="form-inline" action="./upload.php" method="post" enctype="multipart/form-data">
      <button type="button" class="btn btn-success">选择文件</button>
      <style type="text/css">
          form{
            position: relative;
          }
          #file{
              position: absolute;
              top: 0px;
              left: 0px;
              width: 85px;
              height: 40px;
              background: red url() 0 0 no-repeat;
              opacity: 0;
          }
          #file input{
              width: 85px;
              height: 40px;
          }
      </style>
		  <div class="form-group" id="file">
		    <label class="sr-only" for="exampleInputEmail3">用户名</label>
		    <input type="file" name="file[]"  multiple="multiple">
		  </div>
		  <button type="submit" class="btn btn-success">上传</button>
		  
		</form>
    <table class="table table-hover table-striped" style="margin-top:20px">
      <thead>
        <tr>
          <th>文件名</th>
          <th>类型</th>
          <th>大小</th>
          <th>创建时间</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($files as $k => $row) { ?>
        
        <tr>
          <td><?php echo basename($row); ?></td>
          <td><?php echo getSuffux(basename($row)); ?></td>
          <td><?php echo Fsize(filesize($row)); ?></td>
          <td><?php echo Ftime(filectime($row)); ?></td>
          <td>
            <a href="./del.php?url=<?php echo $row ?>" class="btn btn-danger">删除</a>
            <a href="./down.php?url=<?php echo $row ?>" class="btn btn-info">下载</a>
          </td>
        </tr>

        <?php } ?>
        
      </tbody>
    </table>

    <nav aria-label="Page navigation">
        <ul class="pagination">
          <?php if($p==1){ ?>

          <li class="disabled">
            <a aria-label="Previous">
              <span aria-hidden="true">&laquo;</span>
            </a>
          </li>

          <?php }else{ ?>

          <li>
            <a href="./index.php?p=<?php echo $p-1; ?>" aria-label="Previous">
              <span aria-hidden="true">&laquo;</span>
            </a>
          </li>

          <?php } ?>
          

          
          <?php if($p<3) { 

            $max = $total>5 ? 5 : $total;

            ?>
            <?php for ($i=1; $i <= $max; $i++) {  ?>
            <li class="<?php if($i==$p){ echo "active"; } ?>"><a href="./index.php?p=<?php echo $i; ?>"><?php echo $i; ?></a></li>
            <?php } ?>

          <?php }else{ ?>

          <?php for ($i=$p-2; $i <=$p+2 ; $i++) {  ?>
            <li class="<?php if($i==$p){ echo "active"; } ?>"><a href="./index.php?p=<?php echo $i; ?>"><?php echo $i; ?></a></li>
          <?php } ?>

          <?php } ?>

          <?php if($p==$total){ ?>

          <li class="disabled">
            <a aria-label="Previous">
              <span aria-hidden="true">&raquo;</span>
            </a>
          </li>

          <?php }else{ ?>

          <li>
            <a href="./index.php?p=<?php echo $p+1; ?>" aria-label="Previous">
              <span aria-hidden="true">&raquo;</span>
            </a>
          </li>

          <?php } ?>
        </ul>
      </nav>

      <hr>

      <footer>
        <p>&copy; 2016 Company, Inc.</p>
      </footer>
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
  </body>
</html>
